<%@ page language="java" pageEncoding="UTF-8" import="ll.sms.pojo.*"%>
<%@page import="java.util.*,ll.sms.pojo.ChannelCombox,ll.sms.util.*"%>
<%@page import="ll.sms.util.AdminProperty"%>
<%@page import="ll.sms.web.SmsAppContainer"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>用户列表</title>
		<link rel="stylesheet" type="text/css" href="../ext/ext-all.css" />
		<link rel="stylesheet" type="text/css" href="../ext/sms.css" />
		<script type="text/javascript" src="../ext/ext-base.js"></script>
		<script type="text/javascript" src="../ext/ext-all.js"></script>

<script type="text/javascript">
Ext.BLANK_IMAGE_URL = '../images/s.gif';
</script>
	<script type="text/javascript">
	Ext.onReady(function(){

    var swin;
	var AdminRecord = Ext.data.Record.create([
        {name: 'uids', type: 'string'},
        {name: 'uuname', type: 'string'},
        {name: 'upwd', type: 'string'},
        {name: 'uphone', type: 'string'},
        {name: 'ucompany', type: 'string'},
        {name: 'usmsnum', type: 'int'},
        {name: 'uavailable', type: 'int'},
        {name: 'uregisttime', type: 'string'}

    ]);

    var store = new Ext.data.Store({
        proxy: new Ext.data.HttpProxy({url: '../ajaxjsp/userlist.jsp'}),
        reader: new Ext.data.JsonReader({
        totalProperty: 'totalCount',
        root: 'result'
        },AdminRecord),
        remoteSort: true
    });

    var columns = new Ext.grid.ColumnModel([
        new Ext.grid.RowNumberer(),
        {header: '用户名', dataIndex: 'uuname'},
        {header: '联系方式', dataIndex: 'uphone'},
        {header: '可发信息数', dataIndex: 'usmsnum'}
    ]);

    columns.defaultSortable = true;

        var grid = new Ext.grid.GridPanel({
        title: '用户列表',
        region: 'center',
        loadMask: true,
        store: store,
        cm: columns,
        viewConfig: {
        columnsText:'显示的列',
        sortAscText:'升序',
        sortDescText:'降序',
        forceFit: true
        },
        bbar: new Ext.PagingToolbar({
            pageSize: 15,
            store: store,
            displayInfo: true,
            displayMsg: '显示 {0} 条到 {1} 条记录，一共 {2} 条',
            emptyMsg:'没有记录'

        })
    });

    store.load({params:{start:0,limit:15}});
	var viewport = new Ext.Viewport({
	renderTo:'mt',
	layout:'border',
	items:[
	grid,
	{region:'south',contentEl:'inp',heigth:40}
	]
	});
});
	</script>
  </head>

  <body>
   <div id="mt"></div>
   <div id="north1"></div>
   <div id="south"></div>
    <div id="wait" align="center"></div>
   <input id="inp" value="刷新页面" type="button" onclick="javascript:window.location.reload();"></input>
  </body>
</html>
